﻿window.eh = (window.eh || {});
$.extend(window.eh, {
    _to: null,
    echo: function (msg) { $("#echo").append("<li>" + msg + "</li>"); },
    clearEcho: function () { $("#echo").empty(); },
    requestStarting: function () {
        if (eh._to) { clearTimeout(eh._to); eh.clearEcho(); }
        eh.echo("Request Starting Callback");
    },
    requestEnding: function () { eh.echo("Request Ending Callback"); },
    requestEnded: function () {
        eh.echo("Request Ended Callback");
        eh._to = setTimeout(function () { eh.clearEcho(); }, 2000);
    }
});